import QtQuick
import QtQuick.Controls

Rectangle {
    color: "lightgray"

    Column {
        anchors.centerIn: parent
        spacing: 10

        Button {
            text: "从文件中加载组件"
            onClicked: loader.source = "component/MyComponent.qml"
        }

        Button {
            text: "卸载组件"
            onClicked: loader.source = ""
        }

        Loader {
            id: loader
            width: 300
            height: 300
        }
    }
}
